package org.nbict.iot;

/**
 * Created by songseven on 18/7/17.
 */
public class Pair<L, R> {

    private L left;
    private R right;

    public Pair() {
    }

    public Pair(L left, R right) {
        this.left = left;
        this.right = right;
    }

    public L getLeft() {
        return left;
    }

    public R getRight() {
        return right;
    }

    public void clearR() {
        this.right = null;
    }

    public void clearL() {
        this.right = null;
    }

    public void setLeft(L left) {
        this.left = left;
    }

    public void setRight(R right) {
        this.right = right;
    }

    public Pair clear() {
        this.left  = null;
        this.right = null;
        return this;
    }

    public boolean isEmpty() {
        return left == null && right == null;
    }
}
